Go to original window after updating breakpoint#1
Open
susam wants to merge 1 commit intovim-scripts:masterfrom
Open
Go to original window after updating breakpoint#1susam wants to merge 1 commit intovim-scripts:masterfrom
susam wants to merge 1 commit intovim-scripts:masterfrom
Conversation
Fix an issue that causes the cursor to sometimes jump to the taglist
window while debugging with Conque GDB while taglist window is open.
Perform the following steps to reproduce the issue.
Install exuberant-ctags, taglist and Conque GDB.
aptitude install exuberant-ctags
wget http://www.vim.org/scripts/download_script.php?src_id=19574 -O taglist.zip
unzip taglist.zip -d ~/.vim
wget "http://www.vim.org/scripts/download_script.php?src_id=22163" -O conque_gdb.vmb
vim +"silent so % | q" conque_gdb.vmb
Create a file called foo.c with the following C code.
#include <stdio.h>
void foo()
{
printf("1\n");
printf("2\n");
printf("3\n");
}
int main()
{
printf("1\n");
printf("2\n");
foo();
printf("3\n");
return 0;
}
Compile the C code. Then launch Vim with the source code.
$ gcc -g foo.c
$ vim foo.c
In Vim, execute the following commands.
:TlistOpen
Ctrl-w w
:ConqueGdb a.out
Then in GDB, execute the following commands.
break main
next
next
step
next
At some point while executing these commands, the cursor moves
to the taglist window. One now was to enter
`<Esc> Ctrl-w w Ctrl-w w` to return back to the GDB window. This
is a major inconvenience while debugging.
This occurs because in conque_gdb#breakpoint function, after
moving to another window, it uses the `noautocmd wincmd p`
command to return to the previous window. Normally, this works
fine because this is the sequence in which Conque GDB moves from
one window to another:
(Previous window)
+--------------+
V |
GDB window -> Code window
But when taglist is also being used, previous window is no
longer the GDB window. When we `step` into a new function using
GDB, and execute `next`, taglist moves to the taglist window to
update what it shows and then returns to the code window.
Therefore, now when GDB tries to move to the previous window,
the previous window is the taglist window as shown below.
(Previous window)
+----------------+
V |
GDB window -> Code window -> taglist window -> Code window
This is the cause of the issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix an issue that causes the cursor to sometimes jump to the taglist
window while debugging with Conque GDB while taglist window is open.
Perform the following steps to reproduce the issue.
Install exuberant-ctags, taglist and Conque GDB.
Create a file called foo.c with the following C code.
Compile the C code. Then launch Vim with the source code.
In Vim, execute the following commands.
Then in GDB, execute the following commands.
At some point while executing these commands, the cursor moves
to the taglist window. One now has to enter
<Esc> Ctrl-w w Ctrl-w wto return back to the GDB window. Thisis a major inconvenience while debugging.
This occurs because in conque_gdb#breakpoint function, after
moving to another window, it uses the
noautocmd wincmd pcommand to return to the previous window. Normally, this works
fine because this is the sequence in which Conque GDB moves from
one window to another:
But when taglist is also being used, previous window is no
longer the GDB window. When we
stepinto a new function usingGDB, and execute
next, taglist moves to the taglist window toupdate what it shows and then returns to the code window.
Therefore, now when GDB tries to move to the previous window,
the previous window is the taglist window as shown below.
This is the cause of the issue.